package com.rc.saas.tenant.vo.recharge;

import com.alibaba.excel.annotation.ExcelProperty;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.rc.saas.tenant.common.utils.StringUtil;
import org.springframework.format.annotation.DateTimeFormat;

import java.math.BigDecimal;
import java.util.Date;

public class RechargeOrderExportVo {
    @ExcelProperty(value = "运营商代码",index = 0)
    private String tenantCode;
    @ExcelProperty(value = "会员名",index = 1)
    private String nickname;
    @ExcelProperty(value = "商户订单号",index = 2)
    private String outTradeNo;
    @ExcelProperty(value = "支付订单号",index = 3)
    private String transactionId;
    @ExcelProperty(value = "充值金额",index =4 )
    private BigDecimal amount;
    @ExcelProperty(value = "实扣金额",index = 5)
    private BigDecimal factAmount;
    @ExcelProperty(value = "减免金额",index = 6)
    private BigDecimal giveAmount;
    @ExcelProperty(value = "到帐状态",index = 7)
    private String status;
    @ExcelProperty(value = "付款时间",index = 8)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date createdTime;
    @ExcelProperty(value = "充值方式",index = 9)
    private String rechargeType;
    @ExcelProperty(value = "支付方式",index = 10)
    private String paymentType;


    public String getStatus() {
        if (StringUtil.isNotBlank(status)) {
            if ("0".equals(status)) {
                return "未到账";
            } else if ("1".equals(status)) {
                return "已到账";
            }
        }
        return "";
    }

    public String getPaymentType() {
        if (StringUtil.isNotBlank(paymentType)) {
            if ("0".equals(paymentType)) {
                return "微信支付";
            } else if ("1".equals(paymentType)) {
                return "支付宝";
            } else if ("Z0".equals(paymentType)) {
                return "中行微信";
            } else if ("Z1".equals(paymentType)) {
                return "中行支付宝";
            } else if ("U".equals(paymentType)) {
                return "银联支付";
            } else if ("C".equals(paymentType)){
                return "农行支付";
            }
        }
        return "";
    }

    public String getRechargeType() {
        if (StringUtil.isNotBlank(rechargeType)) {
            if ("0".equals(rechargeType)) {
                return "公众号";
            } else if ("1".equals(rechargeType)) {
                return "APP";
            } else if ("2".equals(rechargeType)) {
                return "小程序";
            }
        }
        return rechargeType;
    }

    public void setRechargeType(String rechargeType) {
        this.rechargeType = rechargeType;
    }

    public void setPaymentType(String paymentType) {
        this.paymentType = paymentType;
    }

    public String getTenantCode() {
        return tenantCode;
    }

    public void setTenantCode(String tenantCode) {
        this.tenantCode = tenantCode;
    }

    public String getNickname() {
        return nickname;
    }

    public void setNickname(String nickname) {
        this.nickname = nickname;
    }

    public String getOutTradeNo() {
        return outTradeNo;
    }

    public void setOutTradeNo(String outTradeNo) {
        this.outTradeNo = outTradeNo;
    }

    public String getTransactionId() {
        return transactionId;
    }

    public void setTransactionId(String transactionId) {
        this.transactionId = transactionId;
    }

    public BigDecimal getAmount() {
        return amount;
    }

    public void setAmount(BigDecimal amount) {
        this.amount = amount;
    }

    public BigDecimal getFactAmount() {
        return factAmount;
    }

    public void setFactAmount(BigDecimal factAmount) {
        this.factAmount = factAmount;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public Date getCreatedTime() {
        return createdTime;
    }

    public void setCreatedTime(Date createdTime) {
        this.createdTime = createdTime;
    }

    public BigDecimal getGiveAmount() {
        return giveAmount;
    }

    public void setGiveAmount(BigDecimal giveAmount) {
        this.giveAmount = giveAmount;
    }
}
